{% extends 'base.html.twig' %}

{% block title 'New Remote' %}

{% block alt_title 'Create a new remote repository configuration' %}

{% block content %}
<form action="{{ path('manage_remote_create') }}" method="post">
<div class="row">
    <div class="col-xs-12 col-sm-6 col-md-3">
        <div class="box box-warning">
            <div class="box-header">
                <h3 class="box-title">Configure Remote</h3>                                    
            </div>

            <div class="box-body">
                <div class="form-group">
                    <label for="name">Name</label>
                    <input type="text" name="name" value="{{ remote.name }}" placeholder="Enter name" id="name" class="form-control" required>
                </div>
                <div class="form-group">
                    <label for="adapter">Adapter</label>
                    <select id="adapter" name="adapter" class="form-control">
                        {% for adapter in adapters %}
                            <option>{{ adapter.name }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <label for="enabled">
                        <input type="checkbox" name="enabled" value="1" {% if remote.enabled %}checked="checked" {% endif %}id="enabled"> &nbsp; Enabled
                    </label>
                </div>
            </div>

            <div class="box-footer">
                <button class="btn btn-primary" type="submit">Create Remote</button>
            </div>

        </div>
    </div>
    {% for controller in plugin_controllers(constant('Terramar\\Packages\\Plugin\\Actions::REMOTE_NEW')) %}
    <div class="col-xs-12 col-sm-8 col-md-3 plugin-box"{% if not remote.enabled %} style="display: none"{% endif %}>
        {{ render(controller) }}
    </div>
    {% endfor %}
</div>
</form>
{% endblock %}
